/**
 * 
 */
package com.wolfware.athsweb.persistancy.springhibernate;

import java.util.List;

import com.wolfware.athsweb.domain.Country;
import com.wolfware.athsweb.persistancy.dao.CountryDAO;

/**
 * Implementation of Country DAO.
 * 
 * @see CountryDAO
 * @author ChristianStrzadala
 */
public class SpringHibernateCountryDAOImpl extends AbstractSpringHibernateGenericDAOImpl<Long, Country> implements CountryDAO {

	/**
	 * 
	 */
	public SpringHibernateCountryDAOImpl(){
		super(Country.class);
	}

	/**
	 * {@inheritDoc}
	 */
	public List<Country> getAllCountries() {
		return findAll();
	}
	
	/**
	 * {@inheritDoc}
	 */
	public Country getCountryById(Long id) {
		return read(id);
	}

	/**
	 * {@inheritDoc}
	 */
	public void saveCountryEntries(List<Country> countryList) {
        for (Country country : countryList) {
            create(country);
        }
	}
	
	/**
	 * {@inheritDoc}
	 */
	public void saveCountryEntry(Country country) {
		create(country);
	}
	
	/**
	 * {@inheritDoc}
	 */
	public void updateCountryEntry(Country country) {
		update(country);
	}

	/**
	 * {@inheritDoc}
	 */
	public void deleteCountryEntry(Country country) {
		delete(country);
	}
}